home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / e / misc.txt / 000050_jaltman2@nyc.rr.com_Thu Dec 28 12:33:51 2006.msg < prev    next >
Internet Message Format  |  2020-01-01  |  2KB

  1. Path: reader2.panix.com!reader1.panix.com!panix!news.maxwell.syr.edu!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!post02.iad01!roadrunner.com!not-for-mail
  2. Message-ID: <4592EB8D.2050307@nyc.rr.com>
  3. Date: Wed, 27 Dec 2006 16:54:21 -0500
  4. From: Jeffrey Altman <jaltman2@nyc.rr.com>
  5. Organization: Send private replies to jaltman at mit dot edu
  6. User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
  7. MIME-Version: 1.0
  8. Newsgroups: comp.protocols.kermit.misc
  9. Subject: Re: ftp check usage
  10. References: <1166820118.724272.114490@80g2000cwy.googlegroups.com>   <slrneooln8.grv.fdc@panix3.panix.com>   <1167229694.435877.237650@48g2000cwx.googlegroups.com>   <45928c3e$0$4877$4c368faf@roadrunner.com> <1167238425.623478.174680@48g2000cwx.googlegroups.com>
  11. In-Reply-To: <1167238425.623478.174680@48g2000cwx.googlegroups.com>
  12. Content-Type: text/plain; charset=ISO-8859-1
  13. Content-Transfer-Encoding: 7bit
  14. Lines: 39
  15. X-Complaints-To: abuse@rr.com
  16. Xref: panix comp.protocols.kermit.misc:15622
  17.  
  18. There definitely is a bug here.  FTP CHECK <file> is implemented as:
  19.  
  20.     case FTP_CHK:     /* Check if remote file(s) exist(s) */
  21.         if ((x = cmtxt("remote filename", "", &s, xxstring)) < 0)
  22.           return(x);
  23.         CHECKCONN();
  24.         success = remote_files(1,(CHAR *)s,NULL,0) ? 1 : 0;
  25.         return(success);
  26.  
  27. The problem is that remote_files() returns a CHAR * not a success
  28. or failure value.
  29.  
  30. In this case, because no pattern parameter is being specified,
  31. the return value is a pointer to the static buffer containing
  32.  
  33.    /bin/ls: tst: No such file or directory
  34.  
  35. This is because in remote_files() the NLST case doesn't handle
  36. the situation where the server returns an error string instead
  37. of the file name.
  38.  
  39.     if (mgetmethod == SND_NLS) {    /* NLST... */
  40.     if (pattern) {
  41.         if (!ckmatch((char *)pattern,p,(servertype == SYS_UNIX),1))
  42.           goto again;
  43.     }
  44.     }
  45.  
  46. The end result is that the non-NULL return is being treated as
  47. a success value.
  48.  
  49. This could be fixed by treating by using the 'arg' as the 'pattern'
  50. in the NLST case if 'pattern' is not specified or by passing in
  51. 'arg' as the 'pattern' into the remote_files() call in the FTP_CHK
  52. block.
  53.  
  54. Jeffrey Altman
  55. Secure Endpoints Inc.
  56.